# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=intensio-obfuscator
pkgver=280.f66a22b
pkgrel=8
pkgdesc='Obfuscate a python code 2 and 3.'
arch=('any')
groups=('blackarch' 'blackarch-misc')
url='https://github.com/Hnfull/Intensio-Obfuscator'
license=('MIT')
depends=('python' 'python-tqdm' 'python-colorama' 'python-progress')
makedepends=('git' 'python-setuptools')
source=("$pkgname::git+https://github.com/Hnfull/Intensio-Obfuscator.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

build() {
  cd $pkgname

  python setup.py build
}

package() {
  cd $pkgname
  python setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" *.md
  install -Dm 644 -t "$pkgdir/usr/share/licenses/$pkgname/" LICENSE.txt

  cp -a --no-preserve=ownership docs/ "$pkgdir/usr/share/doc/$pkgname/"

  mv "$pkgdir/usr/bin/intensio_obfuscator" "$pkgdir/usr/bin/$pkgname"
}

